<template>
  <div>
    <!--条件筛选-->
    <TopFilter :list="topFilterList" :cols="3" labelWidth="110" @filterChange="changeHandle" @onCollapse="collapseHandle"></TopFilter>
    <!--操作 -->
    <button-area :style="{ paddingLeft: '80px' }"></button-area>
    <div>
      <FormPanel ref="formPanel" :list="formList" :cols="3" :labelWidth="160" :formType="type" :isSubmitBtn="false" @formChange="formChangeHandle" />
    </div>

  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { getRepairTotal } from '@/api/repair/queryStatistics/queryAccounts';


export default {
  name: 'LHMMaintainProcedureStatistics',
  components: {

  },
  mixins: [dictionary],
  data() {
    return {
      topFilterList: this.createTopFilterList(),
      visible: false,
      visible1: false,
      dialogTitle: '',
      // 查询/条件查询
      formList: this.createFormList()
    };
  },
  mounted() {
  },
    created() {
    this.init();
  },
  methods: {
    createTopFilterList() {
      return [ 
          {
            type: 'RANGE_DATE',
            label: '日期范围',
            fieldName: 'beginDate|endDate',
            placeholder: '选择日期'
          } 
      ];
    },
   createFormList() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '车辆识别率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '识别开单结算数',
          disabled:true,
          fieldName: 'sbkdjszs'
        },
        {
          type: 'INPUT',
          label: '已开单车辆总数(已上牌)',
          disabled:true,
          fieldName: 'ykdclzs'
        },
        {
          type: 'INPUT',
          label: '车辆识别率',
          disabled:true,
          fieldName: 'clsbl'
        },
        {
          type: 'BREAK_SPACE',
          label: '出迎数',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '1-15分钟出迎数',
          disabled:true,
          fieldName: 'cys1'
        },
        {
          type: 'INPUT',
          label: '16-30分钟出迎数',
          disabled:true,
          fieldName: 'cys16'
        },
        {
          type: 'INPUT',
          label: '31-60分钟出迎数',
          disabled:true,
          fieldName: 'cys31'
        },
        {
          type: 'INPUT',
          label: '60分钟以上出迎数',
          disabled:true,
          fieldName: 'cys60'
        },
          {
          type: 'BREAK_SPACE',
          label: '上线数',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '1-15分钟上线数',
          disabled:true,
          fieldName: 'sxs1'
        },
        {
          type: 'INPUT',
          label: '16-30分钟上线数',
          disabled:true,
          fieldName: 'sxs16'
        },
        {
          type: 'INPUT',
          label: '31-60分钟上线数',
          disabled:true,
          fieldName: 'sxs31'
        },
        {
          type: 'INPUT',
          label: '60分钟以上线数',
          disabled:true,
          fieldName: 'sxs60'
        },
        {
          type: 'BREAK_SPACE',
          label: '机修刷单率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已结算刷单委托书数',
          disabled:true,
          fieldName: 'yjssds'
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '机修刷单率',
          disabled:true,
          fieldName: 'jxsdl'
        },
        {
          type: 'BREAK_SPACE',
          label: '刷单正确率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已结算刷单委托书数',
          disabled:true,
          fieldName: 'yjssds'
        },
        {
          type: 'INPUT',
          label: '已结算正确刷单委托书总数',
          disabled:true,
          fieldName: 'yjszqsds'
        },
        {
          type: 'INPUT',
          label: '刷单正确率',
          disabled:true,
          fieldName: 'sdzql'
        },
        {
          type: 'BREAK_SPACE',
          label: '质检率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已结算质检委托书数',
          disabled:true,
          fieldName: 'YZJJSS'
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '质检率',
          disabled:true,
          fieldName: 'ZJL'
        },
        {
          type: 'BREAK_SPACE',
          label: '内返率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '内返数',
          disabled:true,
          fieldName: 'NFJSS'
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '内返率',
          disabled:true,
          fieldName: 'NFL'
        }, 
        {
          type: 'BREAK_SPACE',
          label: '洗车率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已结算洗车委托书数',
          disabled:true,
          fieldName: 'XCJSS'
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '洗车率',
          disabled:true,
          fieldName: 'XCL'
        }, 
        {
          type: 'BREAK_SPACE',
          label: '及时交单率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '及时交单委托书数',
          disabled:true,
          fieldName: 'JSJCDS'
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '及时交单率',
          disabled:true,
          fieldName: 'JSJDL'
        }, 
        {
          type: 'BREAK_SPACE',
          label: '及时结算率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '及时结算委托书数',
          disabled:true,
          fieldName: 'JSJSDS'
        },
        {
          type: 'INPUT',
          label: '已结算委托书总数',
          disabled:true,
          fieldName: 'JSDS'
        },
        {
          type: 'INPUT',
          label: '及时结算率',
          disabled:true,
          fieldName: 'JSJSL'
        },
        {
          type: 'BREAK_SPACE',
          label: '准时交车率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '准时交车数量',
          disabled:true,
          fieldName: 'ZSJCDS'
        },
        {
          type: 'INPUT',
          label: '已完工委托书总数',
          disabled:true,
          fieldName: 'YWGWTSS'
        },
        {
          type: 'INPUT',
          label: '准时交车率',
          disabled:true,
          fieldName: 'ZSJCL'
        },
        {
          type: 'BREAK_SPACE',
          label: '强制完工审核率',
          style: {}
        },
        {
          type: 'INPUT',
          label: '已开单委托书总数',
          disabled:true,
          fieldName: 'ykdwtszs'
        },
        {
          type: 'INPUT',
          label: '强制完工审核数',
          disabled:true,
          fieldName: 'qzwgshs'
        },
        {
          type: 'INPUT',
          label: '强制完工审核率',
          disabled:true,
          fieldName: 'qzwgshl'
        },
      ];
    },
    init(){

    },

    formChangeHandle(val) {
      this.saveData = val;
    },

    async changeHandle(val) {
      console.log("res",val)
      let res = await getRepairTotal(val);
      console.log(res.data,'数据')
      this.formList.forEach(x => {
          x.initialValue = res.data[0][x.fieldName];
      });
      // this.fetchParams = Object.assign({}, val);
    },
    collapseHandle() {
      this.$nextTick(() => {
        this.BaseTable.EXECUTE_RESET_HEIGHT();
      });
    },
  }
};
</script>

<style lang="less" scoped></style>
